package com.sns.connect.ui;

import com.sns.connect.R;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MailLogin extends Activity{
	private EditText mUsername;
	private EditText mPassword;
	private SharedPreferences mPreferences;
	private Button confirm;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mail_login);
		confirm = (Button)findViewById(R.id.confirm);
		confirm.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				mPreferences = getSharedPreferences("sns_config", Context.MODE_PRIVATE);
				mUsername = (EditText)findViewById(R.id.username);
				mPassword = (EditText)findViewById(R.id.password);
				Editor editor = mPreferences.edit();
				editor.putString("username", mUsername.getText().toString());
				editor.putString("password", mPassword.getText().toString());
				editor.commit();
				MailLogin.this.finish();
			}
		});
	}
}
